home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
B-Book Series
/
(k)b2.d64
/
exe105
< prev
next >
Wrap
Text File
|
2007-02-28
|
726b
|
36 lines
0010 PRINT CHR$(147) //CLEAR SCREEN//
0020 //
0030 PRINT "HOW MANY EXERCISES",
0040 INPUT MAXNO
0050 FOR NO:=1 TO MAXNO DO
0060 A:=RND(1,5); B:=RND(1,5)
0070 RESULT:=A+B
0080 EXERCISE
0090 GETANSWER
0100 CONTROL
0110 ENDFOR NO
0120 //
0130 PROC EXERCISE
0140 FOR I:=1 TO 3 DO PRINT
0150 PRINT "----------------------------"
0160 PRINT "EXERCISE NO. ",NO
0170 PRINT
0180 ENDPROC EXERCISE
0190 //
0200 PROC GETANSWER
0210 PRINT A," + ",B," = ",
0220 INPUT "": ANSWER
0230 PRINT
0240 ENDPROC GETANSWER
0250 //
0260 PROC CONTROL
0270 IF ANSWER=RESULT THEN
0280 PRINT "THAT'S CORRECT!"
0290 ELSE
0300 PRINT "YOUR ANSWER IS NOT CORRECT;"
0310 PRINT
0320 PRINT A," + ",B," = ",RESULT
0330 ENDIF
0340 ENDPROC CONTROL
0350 //